﻿/*******************************************************************************

    Units of Measure for C# applications

    Copyright (C) 2013 Marek Aniola

    This program is provided to you under the terms of the license
    as published at http://unitsofmeasure.codeplex.com/license


********************************************************************************/
using System;
using System.Globalization;

namespace Man.UnitsOfMeasure
{
	internal interface ITypeHost<T> where T : struct
	{
		T Zero { get; }
		T Unity { get; }

		T Negative(T x);

		T Add(T x, T y);
		T Subtract(T x, T y);
		T Multiply(T x, T y);
		T Divide(T x, T y);

		T Pow(T x, int num, int den);

		bool Equal(T x, T y);

		int Compare(Quantity<T> x, Quantity<T> y);
		int Compare(Level<T> x, Level<T> y);

		T Calibrate(Quantity<T> q, Measure<T> target);
		T Calibrate(Level<T> q, Measure<T> target);

		bool TryParse(string input, NumberStyles style, IFormatProvider fp, out T result);
	}
}
